import java.io.Serializable;

import commpackage.SessionCallback;

class TestCallback extends SessionCallback
{
	private boolean stop;

	public TestCallback()
	{
		stop = false;
	}

	public boolean needStop()
	{
		return stop;
	}

	public void onSendError(int message_id,String message,boolean dropped_connection)
	{
		synchronized(this)
		{
			System.out.println("Send Error " + message);
		}
	}

	public void onReceiveError(int message_id, String message, boolean dropped_connection)
	{
		synchronized(this)
		{
			System.out.println("Receive Error " + message);
		}
	}

	public void onReceive(int message_id, Serializable obj)
	{
		synchronized(this)
		{
			String str = (String)obj;
			System.out.println("Object Returned was " + str);
			stop=true;
		}
	}
}